CrypTaxCalc Helps You Calculate Tax and Gain or Loss on Crypto Currency Sales - Svendsen Tech

CrypTaxCalc

Svendsen Tech, a company based in Norway, has created a simple product called CrypTaxCalc to facilitate reporting correct numbers from crypto currency exchanges/sales (treated as taxable events) to the tax department.

This is for an international, and likely slightly technical, audience. The tax percentages should be customized/adapted to year/country as relevant to your situation. The default values are for Norway in 2022 (35.2 % tax on earnings, 22 % deduction on losses).

If you have bought and - more interestingly for the sake of taxes - sold or exchanged one or more crypto currencies (including buying a cup of coffee), you have a responsibility to correctly report taxes.

CrypTaxCalc calculates the foundation you need for reporting taxes to the government. Some limitations apply, see below. I was relieved when I finished this product for personal use. It will help me.

CrypTaxCalc will give you the exact amounts you owe or can claim in taxes. In some countries there is no upper limit on deductions, and a fixed percentage is used. If there is a limit on deductions, you can view the summary with the -ShowSummary parameter to see what the total loss was/is and report accordingly.

It will calculate the real purchase value, possibly spread over many purchases for one sale, provided everything is correct in the spreadsheet/CSV file.

It uses a FIFO, LIFO, HPFO, or LPFO algorithm. Purchases and sales are processed sequentially based on the information in the comma-separated file (.csv) that can easily be exported from Excel or another spreadsheet app, before processing it with CrypTaxCalc.

CrypTaxCalc is written in PowerShell, which is already on your computer if you use Windows, and is available for Linux and macOS. See how to start PowerShell on Windows on HowToGeek here if you are unfamiliar with it. To install PowerShell on Linux or macOS, see Microsoft's documentation on GitHub here.

CoinTracker, and other products, such as kryptosekken.no (for Norwegians) are super professional and comprehensive crypto tax and reporting tools that even connect with tax software and crypto exhcanges. They have apps and incredible features. My version is a low-budget blues band variant that pales in comparison, but caters to a potentially global audience with some, but limited, technical skill.

The price for my simple CrypTaxCalc is 10 USD/EUR. It supports unlimited transactions. If you want to buy it, you can contact me at svendsentech@gmail.com. Basically, the process is that you donate 10 USD with PayPal (see the bottom of any page on this website) and contact me from the same address, or refer to the address the donation was made from, and I will make the code available to you for use as soon as I can (normally within 2 days). I have not had a chance to automate this yet. I will set up automated distribution and sale of the software. Expecting 0 sales... Too bad; it's cheap and useful.

After I myself was in a situation where I needed to report numbers representing crypto currency sales to the tax department, I had to create a solution. The result is a FIFO, LIFO, HPFO, and LPFO algorithm with focus on crypto currency coins, but it can be used for any type of product/numbers.

FIFO is short for "First In, First Out", and means that if you buy 10 bitcoin twice for a total holding of 20 bitcoin and then sell 5 coins (that are taken at the rate from the first 10 you bought), then another 10 coins (5 at the rate from the first 10, and the next 5 at the rate from the last 10 you bought), it keeps track of all this and calculates everything correctly for you.

LIFO is short for "Last In, First Out". HPFO is short for "Highest Price First Out" (this is the most economical method with maximum delay in taxes). LPFO is short for "Lowest Price First Out".

No matter if you bought 2500 times for $10 each or once for $25,000, everything will be calculated correctly when you sell, as long as you get everything correctly into the spreadsheet (only buy/sell/exchange) and in the right order. Prepare for some typing up front before the hardest part is taken care of for you by CrypTaxCalc.

Limitations

It's sold under the MIT license. This means "as is" and no warranties. I will work to resolve any reported issues or bugs, but the MIT license makes me not responsible for bugs or errors. That said, I'm using it for my own tax report, so, of course, I have good faith that the information it produces is accurate.

Limitations apply in that mining and income (such as Coinbase Earn) are not handled. CrypTaxCalc handles only purchases with a fiat ("real") currency or exchanges from another crypto currency, paired with sales and exchanges to other fiat or crypto currencies (the latter are regarded as sales/realizations that must be reported). Requirements for the code/script to be able to calculate what is needed are five things for each purchase and sale. They are as follows:

If you can make a spreadsheet with everything starting from the first purchase to your last sale or purchase, CrypTaxCalc will be able to calculate the net gain or loss for each sale - and also how much tax you have to pay, if you provide correct -GainTaxPercent x.x and -LossTaxPercent x.x parameters and values. The default values are for Norway in the year 2022.

Example Spreadsheet for Bitcoin


Example output:

To verify the results, and rule out bugs and mistakes, you can add the parameter -ListUsedBuyAmounts for more information. This will list each "dipped into purchase" and how the amounts are kept track of based on my FIFO, LIFO, HPFO, LPFO algorithm. You can also use the parameter "-Verbose" to list verbose output while the script is processing the buys and sales (or exchanges).

Example:

PS /tmp> $Results = ./CrypTaxCalc.ps1 `
 -CsvFilePath ./bitcoin-tax-sheet-public.csv -Verbose -ListUsedBuyAmounts

VERBOSE: Adding buy to buy stack. Amount of coins: 0.01587235
VERBOSE: Adding buy to buy stack. Amount of coins: 0.01146855
VERBOSE: Adding buy to buy stack. Amount of coins: 0.03310241
VERBOSE: Processing a sale. Amount of coins: -0.03436041
VERBOSE: Buy stack value: 0.01587235
VERBOSE: Complete buy stack amounts: 0.01587235, 0.01146855, 0.03310241
VERBOSE: Sale (-0.03436041) spans over the current buy amount (0.01587235).
VERBOSE: Popping out first buy stack element as it is used up. Buy stack count before: 3
VERBOSE: Buy stack count after: 2
VERBOSE: Carry over sum is currently: 902.903391455
VERBOSE: Carry over amount is currently: -0.01848806
VERBOSE: Buy stack value: 0.01146855
VERBOSE: Complete buy stack amounts: 0.01146855, 0.03310241
VERBOSE: Sale (-0.01848806) spans over the current buy amount (0.01146855).
VERBOSE: Popping out first buy stack element as it is used up. Buy stack count before: 2
VERBOSE: Buy stack count after: 1
VERBOSE: Carry over sum is currently: 2799.2180416310
VERBOSE: Carry over amount is currently: -0.00701951
VERBOSE: Buy stack value: 0.03310241
VERBOSE: Complete buy stack amounts: 0.03310241
VERBOSE: The buy is -gt the (remaining) sale amount (-0.00701951). Subtracting sale amount from buy stack value. Populating results hash with a sale object.
VERBOSE: -ListUsedBuyAmounts supplied. Listing the amount of the purchase used for this sale.
VERBOSE: Buy stack amount after sale: 0.02608290
VERBOSE: Processing a sale. Amount of coins: -0.01146855
VERBOSE: Buy stack value: 0.02608290
VERBOSE: Complete buy stack amounts: 0.02608290
VERBOSE: The buy is -gt the (remaining) sale amount (-0.01146855). Subtracting sale amount from buy stack value. Populating results hash with a sale object.
VERBOSE: -ListUsedBuyAmounts supplied. Listing the amount of the purchase used for this sale.
VERBOSE: Buy stack amount after sale: 0.01461435
VERBOSE: Adding buy to buy stack. Amount of coins: 0.33290976
VERBOSE: Adding buy to buy stack. Amount of coins: 0.02532042
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00025334
VERBOSE: Adding buy to buy stack. Amount of coins: 8.552E-05
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00022822
VERBOSE: Processing a sale. Amount of coins: -0.18101567
VERBOSE: Buy stack value: 0.01461435
VERBOSE: Complete buy stack amounts: 0.01461435, 0.33290976, 0.02532042, 0.00025334, 8.552E-05, 0.00022822
VERBOSE: Sale (-0.18101567) spans over the current buy amount (0.01461435).
VERBOSE: Popping out first buy stack element as it is used up. Buy stack count before: 6
VERBOSE: Buy stack count after: 5
VERBOSE: Carry over sum is currently: 1672.6944901470
VERBOSE: Carry over amount is currently: -0.16640132
VERBOSE: Buy stack value: 0.33290976
VERBOSE: Complete buy stack amounts: 0.33290976, 0.02532042, 0.00025334, 8.552E-05, 0.00022822
VERBOSE: The buy is -gt the (remaining) sale amount (-0.16640132). Subtracting sale amount from buy stack value. Populating results hash with a sale object.
VERBOSE: -ListUsedBuyAmounts supplied. Listing the amount of the purchase used for this sale.
VERBOSE: Buy stack amount after sale: 0.16650844
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00137625
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00340536
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00771201
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00412855
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00142212
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00152242
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00139921
VERBOSE: Adding buy to buy stack. Amount of coins: 0.00127153
PS /home/joakim/Documents> 

PS /home/joakim/Documents> $Results.Values

If you have a long history with crypto, back to days before Bitcoin was worth $1, for instance, you will need to decide on a starting point, an "epoch", for when the script code starts to calculate the gains and losses. The first buy you register serves as the "epoch"/starting point. In some cases, judgement calls must be made.

    Powershell     Finance     Finans     Bitcoin     Tax     Skatt     Cryptography     Fintech     Kryptovaluta     Crypto Currency     Skattemelding     All Categories

Google custom search of this website only

Minimum cookies is the standard setting. This website uses Google Analytics and Google Ads, and these products may set cookies. By continuing to use this website, you accept this.

If you want to reward my efforts